# Framing Element Method: Code and Data

This repository contains the code and data for the **Framing Element Method**, which includes three main steps:  

## 1. Framing Element Detection  
This step involves detecting framing elements using the following scripts:  

- **`news_labeler.py`**: Generates topics for a sentence or paragraph using the NYT News Labeler.  
- **`abstract_tagger.py`**: Generates topics for an entity based on its Wikipedia abstract.  
- **`limited_wikifier`** and **`unlimited_wikifier`**: Two Wikifier APIs that boost the matching rate between article entities and the Wikipedia database (DBpedia).  
- **`sentence_to_wiki.py`**: Generates topics for entities that cannot be matched using the Wikifier.  
- **`replace_topic.py`**: Replaces 600 topics with 79 categories for entities.  
- **`run.py`**: Runs the entire framing element detection pipeline.  

## 2. Network Data Generation  
- **`network_data_generator.py`**: Converts detected framing elements into a **Framing Element Network** for community detection.  

## 3. Community Detection  
- **`community_detection.py`**: Applies community detection to the generated networks.  

## Usage  
1. Run the framing element detection pipeline using `run.py`.  
2. Generate the network data with `network_data_generator.py`.  
3. Perform community detection with `community_detection.py`.  

